<!--
 * @FileDescription 教学辅助
 * @Author lz
 * @Date 20230223 16:15:34
 * @LastEditors lz
 * @LastEditTime 20230223 16:15:34
-->
<template>
    <div class="teachingAids_wp" v-if="state.show" @mouseenter="mouseenter()" @mouseleave="mouseleave()">
        <div class="tit">教学辅助</div>
        <img src="/colImages/DecorativeLine_l.png" class="line">
        <img src="/colImages/packUp.png" class="packUp" @click="show()">
        <!-- <div class="content_wp">
            <div class="PreviousStep">
                上一步
            </div>
            <div class="suspend">

            </div>
            <div class="nextStep">
                下一步
            </div>
        </div> -->
        <div class="checkedBox  checkedBox1 ">
            <a-checkbox v-model:checked="state.checked" @change="checked1">显示标注线</a-checkbox>
        </div>
        <div class="checkedBox">
            <a-checkbox v-model:checked="state.checked2" @change="checked2">显示坐标系</a-checkbox>
        </div>
        <div class="checkedBox">
            <a-checkbox v-model:checked="state.checked3" @change="checked3">显示标定结果</a-checkbox>
        </div>
    </div>
    <div class="StowedState" v-if="!state.show" @click="show()">
        <img src="/colImages/ExpandArrow_l.png" class="expArr">
    </div>
</template>

<script setup lang="ts">
import { ClientMessage } from '@runtime/generate/message/ClientMessage';
import WebSocketComponent from '@runtime/module/WebSocket/WebSocketComponent';
import { reactive, ref, toRefs, onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onUnmounted, StyleValue, defineProps, defineEmits } from 'vue'
import MessageCode from '../../MessageCode';
import HomeContent from '../../HomeContent';
const state = reactive({
    show: true,
    checked: true,
    checked2: false,
    checked3: false,
});
function mouseenter() {
    HomeContent.Default.isShowMouseLabel.value = false
}
function mouseleave() {
    HomeContent.Default.isShowMouseLabel.value = true
}

function show() {
    state.show = !state.show
}
function checked1(checkedValue: any) {
    WebSocketComponent.Default.PostMessage(new ClientMessage.CalibrationAdapterMessage(MessageCode.Default.MsgCodesList.CALIBRATION_FUNCTION_SHOW_DOR, `${checkedValue.target.checked}`))
}
function checked2(checkedValue: any) {
    WebSocketComponent.Default.PostMessage(new ClientMessage.CalibrationAdapterMessage(MessageCode.Default.MsgCodesList.CALIBRATION_FUNCTION_SHOW_COORDINATES, `${checkedValue.target.checked}`))
}
function checked3(checkedValue: any) {
    WebSocketComponent.Default.PostMessage(new ClientMessage.CalibrationAdapterMessage(MessageCode.Default.MsgCodesList.CALIBRATION_FUNCTION_SHOW_RESULT, `${checkedValue.target.checked}`))
}
onMounted(() => {
    //显示标注线
    WebSocketComponent.Default.PostMessage(new ClientMessage.CalibrationAdapterMessage(MessageCode.Default.MsgCodesList.CALIBRATION_FUNCTION_SHOW_DOR, 'true'))
    //显示坐标系
    WebSocketComponent.Default.PostMessage(new ClientMessage.CalibrationAdapterMessage(MessageCode.Default.MsgCodesList.CALIBRATION_FUNCTION_SHOW_COORDINATES, 'false'))
    //显示标定结果
    WebSocketComponent.Default.PostMessage(new ClientMessage.CalibrationAdapterMessage(MessageCode.Default.MsgCodesList.CALIBRATION_FUNCTION_SHOW_RESULT, 'false'))
})
</script>

<style scoped>
.teachingAids_wp {
    position: absolute;
    left: 0;
    top: 759px;
    width: 290px;
    background-image: url('/colImages/jxfz_bg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding-bottom: 10px;
}

.content_wp {
    display: flex;
    margin-top: 25px;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    color: #00E7FF;
}

.line {
    position: absolute;
    left: 6px;
    top: 32px;
    width: 274px;
    height: 28px;
}

.tit {
    font-size: 22px;
    font-family: YouSheBiaoTiHei;
    font-weight: 400;
    color: #ffffff;
    padding-left: 38px;
    padding-top: 12px;
}

.packUp {
    position: absolute;
    right: 4px;
    top: 13px;
    width: 27px;
    height: 32px;
}

.PreviousStep {
    width: 96px;
    height: 49px;
    text-align: center;
    line-height: 49px;
    background-image: url('/colImages/step_bg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    margin-left: 18px;
}

.nextStep {
    width: 96px;
    height: 49px;
    line-height: 49px;
    text-align: center;
    background-image: url('/colImages/step_bg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.suspend {
    width: 44px;
    height: 43px;
    background-image: url('/colImages/firing.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    margin: 0 11px;
}

.StowedState {
    position: absolute;
    left: 0;
    top: 765px;
    width: 52px;
    height: 52px;
    background-image: url('/colImages/stowedState_l_bg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.expArr {
    width: 27px;
    height: 32px;
    margin-top: 10px;
    margin-left: 13px;
}

.checkedBox {
    margin-left: 20px;
    margin-top: 6px;
}

.checkedBox1 {
    margin-top: 10px;
}

:deep().ant-checkbox-wrapper {
    color: #fff;
}
</style>